package com.yugao.fintech.antelope.shortlink.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yugao.fintech.antelope.base.model.BasePlusPO;
import com.yugao.fintech.antelope.base.tenant.core.DataIsolation;
import com.yugao.fintech.framework.core.annotations.FieldUnique;
import lombok.Getter;
import lombok.Setter;

/**
 * 短链域名
 */
@Getter
@Setter
@TableName("sl_domain")
@DataIsolation(filterTenant = true, tableName = "sl_domain")
public class LinkDomain extends BasePlusPO {
    @TableId
    private Long id;

    /**
     * 关联的用户
     */
    private Long userId;

    /**
     * 域名
     */
    @FieldUnique(message = "域名已存在")
    private String domain;

    /**
     * 0是正常, 1是禁用
     */
    private Integer deleted;

    public static LambdaQueryWrapper<LinkDomain> lqw() {
        return Wrappers.lambdaQuery();
    }
}
